package com.jiesen.resource.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.ObjectMapper;

@Configuration
public class GQLObjectMapper {

    @Bean
    @ConditionalOnMissingBean
    public ObjectMapper objectMapper() {

        ObjectMapper mapper = new ObjectMapper();
        /*
        mapper.getSerializerProvider().setNullValueSerializer(new JsonSerializer<Object>()
        {
            @Override
            public void serialize(Object o, JsonGenerator jsonGenerator,
                                  SerializerProvider serializerProvider)
                    throws IOException
            {
                jsonGenerator.writeString("空数字～～");
            }
        });
        */
        return mapper;
    }
}
